﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Deeper.Common;
using Deeper.Common.Web;
namespace Deeper.Controls
{
	 
	[ToolboxData("<{0}:PopupWindow runat=server></{0}:PopupWindow>")]
	public class PopupWindow : Panel
	{


		[Bindable(true)]
		[DefaultValue("")]
		[Localizable(true)]
		public string Title
		{
			get
			{
				return ViewState.GetFromViewState<string>("Title", string.Empty);
			}
			set
			{
				ViewState["Title"] = value;
			}
		}


		[Bindable(true)]
		[DefaultValue("/images/dialog/icon_dialog.gif")]
		[Localizable(true)]
		public string Icon
		{
			get
			{
				return ViewState.GetFromViewState<string>("Icon", "/images/dialog/icon_dialog.gif");
			}
			set
			{
				ViewState["Icon"] = value;
			}
		}

		protected override void Render(HtmlTextWriter writer)
		{
			if (this.Visible || DesignMode)
				HyControlHelper.RenderTop(writer, Title, Icon);
			base.Render(writer);
			if (this.Visible || DesignMode)
				HyControlHelper.RenderBottom(writer);
		}

		/// <summary>
		/// 显示
		/// </summary>
		public void Show()
		{
			this.Visible = true;
		}
		/// <summary>
		/// 隐藏
		/// </summary>
		public void Hide()
		{
			this.Visible = false;
		}
	}
}
